package com.ydgk.dao;

import com.ydgk.bean.Admin;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface AdminMapper {
    @Select("select count(*) from admin where aname = #{aname}")
    int findCountByAname(Admin admin);

    @Select("select * from admin where aname = #{aname} and apass = #{apass}")
    Admin checkRight(Admin admin);

    @Select("select * from admin where aid = #{aid}")
    Admin findById(Integer aid);

    @Update("update admin set aname = #{aname}, apass = #{apass}, aface = #{aface}, aphone = #{aphone}, aemail = #{aemail}, sign = #{sign} where aid = #{aid}")
    void updateById(Admin admin);
}
